package com.kingwang.training.designpattern.visitor.deep.step4;

/**
 * 平地进攻模式
 *
 * @author King
 */
public class PlainAttackVisitor implements Visitor {
    private int meters;

    public PlainAttackVisitor(int meters) {
        this.meters = meters;
    }

    @Override
    public void visit(MarineSoldier marine) {
        marine.move(this.meters);
        marine.attack();
    }

    @Override
    public void visit(FirebatSoldier firebat) {
        firebat.move(this.meters);
        firebat.attack();
    }

    @Override
    public void visit(Medic medic) {
        medic.move(this.meters);
    }
}
